/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* 防止水平滚动 */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* 字体系统 */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --font-display: 'Montserrat', sans-serif;
    --line-height-body: 1.7;
    --line-height-heading: 1.3;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-wide: 0.05em;

    /* 颜色系统 */
    --color-primary: #507497;
    --color-secondary: #4CAF50;
    --color-accent: #FF6B6B;
    --color-light: #f8f9fa;
    --color-dark: #333;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-background: #ffffff;
    --color-code-bg: #2d3748;
    --color-code-text: #e2e8f0;
    --color-border: #e2e8f0;
    --color-success: #48BB78;
    --color-warning: #ECC94B;
    --color-error: #F56565;
}

body {
    font-family: var(--font-sans);
    line-height: var(--line-height-body);
    color: var(--color-text);
    background-color: var(--color-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0 1rem;
}

/* 头部导航样式 */
header {
    background-color: var(--color-primary);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-height: 70px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    flex-wrap: nowrap;
    position: relative; /* 为移动端主题切换按钮提供定位基准 */
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: var(--letter-spacing-tight);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

.nav-links li {
    margin: 0;
    position: relative;
    flex-shrink: 0;
}

/* 下拉菜单样式 */
.nav-links .dropdown {
    position: relative;
    display: inline-block;
}

.nav-links .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    list-style: none;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 100;
    white-space: nowrap;
    margin-top: 0.5rem;
}

.nav-links .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-links .dropdown-menu li {
    margin: 0;
    width: 100%;
}

.nav-links .dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.nav-links .dropdown-menu a:hover {
    background-color: #f5f5f5;
}

/* 桌面端主题切换按钮样式 */
.theme-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 30px;
    width: 60px;
    height: 30px;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* 移动端顶部主题切换按钮样式 */
.mobile-theme-toggle-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 25px;
    width: 50px;
    height: 25px;
    position: absolute;
    top: 50%;
    right: 80px; /* 避免与汉堡菜单重叠，汉堡菜单宽度约25px + 边距 */
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
    overflow: hidden;
    padding: 0;
    outline: none;
    display: none; /* 默认隐藏，只在移动端显示 */
    z-index: 1001;
    align-items: center;
    justify-content: flex-start;
}

/* 桌面端按钮滑块 */
.theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* 移动端按钮滑块 */
.mobile-theme-toggle-btn::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* 桌面端按钮图标 */
.theme-toggle-btn i {
    position: absolute;
    font-size: 0.8rem;
    transition: all 0.4s ease;
    z-index: 3;
    color: #fbbf24;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 移动端按钮图标 */
.mobile-theme-toggle-btn i {
    position: absolute;
    font-size: 0.7rem;
    transition: all 0.4s ease;
    z-index: 3;
    color: #fbbf24;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 桌面端太阳图标 */
.theme-toggle-btn .fa-sun {
    left: 7px;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* 桌面端月亮图标 */
.theme-toggle-btn .fa-moon {
    right: 7px;
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
    color: #f1c40f;
}

/* 移动端太阳图标 */
.mobile-theme-toggle-btn .fa-sun {
    left: 6px;
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* 移动端月亮图标 */
.mobile-theme-toggle-btn .fa-moon {
    right: 6px;
    opacity: 0;
    transform: rotate(180deg) scale(0.5);
    color: #f1c40f;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.theme-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 深色模式激活状态 */
.theme-toggle-btn.dark-active {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 4px 15px rgba(45, 55, 72, 0.6);
}

.theme-toggle-btn.dark-active::before {
    transform: translateX(30px);
    background: #2d3748;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.theme-toggle-btn.dark-active .fa-sun {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

.theme-toggle-btn.dark-active .fa-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #e2e8f0;
}

.theme-toggle-btn.dark-active:hover {
    box-shadow: 0 6px 20px rgba(45, 55, 72, 0.8);
}

/* 移动端按钮深色模式样式 */
.mobile-theme-toggle-btn.dark-active {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 3px 12px rgba(45, 55, 72, 0.6);
}

.mobile-theme-toggle-btn.dark-active::before {
    transform: translateX(25px);
    background: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mobile-theme-toggle-btn.dark-active .fa-sun {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
}

.mobile-theme-toggle-btn.dark-active .fa-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #e2e8f0;
}

/* 移动端按钮点击效果 - 使用active而非hover避免位置跳动 */
.mobile-theme-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.mobile-theme-toggle-btn.dark-active:active {
    transform: translateY(-50%) scale(0.95);
    box-shadow: 0 2px 8px rgba(45, 55, 72, 0.6);
}

/* 发光效果动画 */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.7);
    }
}

@keyframes glow-dark {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(45, 55, 72, 0.6);
    }
    50% {
        box-shadow: 0 4px 20px rgba(45, 55, 72, 0.9);
    }
}

.theme-toggle-btn:not(.dark-active):focus {
    animation: glow 2s ease-in-out infinite;
    outline: none;
}

.theme-toggle-btn.dark-active:focus {
    animation: glow-dark 2s ease-in-out infinite;
    outline: none;
}

/* 深色模式下的导航栏样式 */
.dark-mode .nav-links .dropdown-menu {
    background-color: #333;
}

.dark-mode .nav-links .dropdown-menu a {
    color: white;
}

.dark-mode .nav-links .dropdown-menu a:hover {
    background-color: #444;
}

/* 响应式设计优化 */
@media screen and (max-width: 768px) {
    /* 隐藏菜单栏中的主题切换按钮 */
    .nav-links .theme-toggle-btn {
        display: none !important;
    }
    
    /* 显示移动端顶部主题切换按钮 */
    .mobile-theme-toggle-btn {
        display: flex !important;
    }
    
    .theme-toggle-btn.dark-active::before {
        transform: translateX(25px);
    }
    
    .theme-toggle-btn i {
        font-size: 0.7rem;
    }
    
    .theme-toggle-btn .fa-sun {
        left: 5px;
    }
    
    .theme-toggle-btn .fa-moon {
        right: 5px;
    }
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-secondary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-secondary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    transition: all 0.3s ease;
}

/* 教程容器布局 */
.tutorial-container {
    display: flex;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    gap: 2rem;
    width: 100%;
    overflow-x: hidden;
}

.tutorial-sidebar {
    flex: 0 0 250px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
    min-width: 0;
}

.tutorial-sidebar h3 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
}

.tutorial-nav {
    list-style: none;
}

.tutorial-nav li {
    margin-bottom: 0.5rem;
}

.tutorial-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.tutorial-nav a:hover {
    background-color: var(--color-light);
    color: var(--color-primary);
}

.tutorial-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    min-width: 0;
    overflow-x: auto;
}

.tutorial-content h1 {
    font-family: var(--font-display);
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.intro {
    font-size: 1.2rem;
    color: var(--color-text-light);
    margin-bottom: 2.5rem;
    line-height: 1.7;
    padding: 1rem;
    background-color: var(--color-light);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 4px 4px 0;
}

.section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.section:last-child {
    border-bottom: none;
}

.section h2 {
    color: var(--color-primary);
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
    font-family: var(--font-display);
    font-weight: 600;
}

.section h3 {
    color: var(--color-text);
    margin: 1.5rem 0 1rem;
    font-family: var(--font-display);
    font-weight: 500;
}

/* 代码块样式 */
.code-block {
    background-color: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 1.5rem;
    border-radius: 6px;
    margin: 1.5rem 0;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-block code {
    color: #81e6d9;
}

.code-block .keyword {
    color: #ff6b6b;
}

.code-block .comment {
    color: #a0aec0;
    font-style: italic;
}

.code-block .string {
    color: #90cdf4;
}

.code-block .number {
    color: #f6ad55;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

th {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

tr:hover {
    background-color: var(--color-light);
}

/* 列表样式 */
ul,
ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* 导航按钮 */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.nav-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.nav-button:hover {
    background-color: #3e6b8f;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/hero.svg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(76, 175, 80, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    transform: scale(0);
    opacity: 0;
    transition: all 1s ease;
}

.hero:hover::before {
    transform: scale(1);
    opacity: 1;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-tight);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.2s;
}

.hero p {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: var(--line-height-body);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.4s;
}

.btn {
    display: inline-block;
    background-color: var(--color-secondary);
    color: white;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: var(--letter-spacing-wide);
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards 0.6s;
}

.btn:hover {
    background-color: #3e8e41;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 特性区域样式 */
.features {
    padding: 6rem 0;
    background-color: var(--color-light);
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, white, transparent);
    z-index: 1;
}

.features h2 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 4rem;
    color: var(--color-text);
    position: relative;
    padding-bottom: 1rem;
}

.features h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--color-secondary);
    border-radius: 2px;
}

.feature-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.feature-box {
    flex: 1 1 300px;
    padding: 2.5rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.feature-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: var(--color-secondary);
    transition: all 0.3s ease;
}

.feature-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-box:hover::before {
    width: 100%;
    opacity: 0.1;
}

.feature-box i {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-secondary);
    transition: all 0.3s ease;
}

.feature-box:hover i {
    transform: scale(1.1) rotate(5deg);
}

.feature-box h3 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--color-text);
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-tight);
}

.feature-box p {
    font-family: var(--font-sans);
    color: var(--color-text-light);
    line-height: var(--line-height-body);
}

/* 学习反馈区域样式 */
.testimonials {
    padding: 6rem 0;
    background-color: white;
    position: relative;
    overflow: hidden;
}

.testimonials::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--color-light);
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
    z-index: 0;
}

.testimonials h2 {
    font-family: var(--font-display);
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 4rem;
    color: var(--color-text);
    position: relative;
    z-index: 1;
    padding-bottom: 1rem;
    line-height: var(--line-height-heading);
    letter-spacing: var(--letter-spacing-tight);
}

.testimonials h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background-color: var(--color-secondary);
    border-radius: 2px;
}

.testimonial-box {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.testimonial-box p {
    font-style: italic;
    color: var(--color-text);
    line-height: var(--line-height-body);
}

.testimonial-box .author {
    font-weight: 600;
    color: var(--color-primary);
    margin-top: 1rem;
    font-style: normal;
}

/* 页脚样式 */
footer {
    background-color: var(--color-dark);
    color: white;
    text-align: center;
    padding: 2rem 0;
    font-family: var(--font-sans);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.modal-content {
    background-color: var(--color-background);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.5s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-button {
    color: var(--color-text-light);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: var(--color-text);
}

.modal-content h2 {
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 2rem;
    font-family: var(--font-display);
    font-weight: 700;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: var(--color-background);
    color: var(--color-text);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(80, 116, 151, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--color-text);
    /* 增强浏览器兼容性 */
    vertical-align: middle;
    position: relative;
    line-height: 1.5;
    font-size: 1rem;
}

.checkbox-label input {
    width: auto;
    margin-right: 0.5rem;
    /* 增强浏览器兼容性 */
    vertical-align: middle;
    flex-shrink: 0;
    height: 16px;
    width: 16px;
    margin-top: 0;
    margin-bottom: 0;
}

.forgot-password {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #3e6b8f;
    text-decoration: underline;
}

.modal-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--color-secondary);
    color: white;
    border: none;
    border-radius: 5px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    background-color: #3e8e41;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 用户协议和隐私政策模态框特定样式 */
.policy-modal-content {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
}

.policy-text {
    text-align: left;
    line-height: 1.8;
    color: var(--color-text);
    font-size: 0.95rem;
}

.policy-text h3 {
    color: var(--color-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.2rem;
    margin: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.policy-text h4 {
    color: var(--color-primary);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1rem;
    margin: 1.5rem 0 0.8rem 0;
}

.policy-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

.policy-text ul, .policy-text ol {
    margin: 1rem 0 1rem 1.5rem;
    padding-left: 1rem;
}

.policy-text li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.policy-text strong {
    color: var(--color-primary);
    font-weight: 600;
}

/* 模态框按钮区域 */
.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
}

.agree-btn {
    background-color: var(--color-secondary);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.agree-btn:hover {
    background-color: #3e8e41;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cancel-btn {
    background-color: var(--color-text-light);
    color: white;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.cancel-btn:hover {
    background-color: var(--color-text);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 滚动条样式 */
.policy-modal-content::-webkit-scrollbar {
    width: 8px;
}

.policy-modal-content::-webkit-scrollbar-track {
    background: var(--color-light);
    border-radius: 4px;
}

.policy-modal-content::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: 4px;
}

.policy-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-text);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .policy-modal-content {
        padding: 1.5rem;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .policy-text {
        font-size: 0.9rem;
    }
    
    .policy-text h3 {
        font-size: 1.1rem;
    }
    
    .policy-text h4 {
        font-size: 0.95rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .agree-btn, .cancel-btn {
        width: 100%;
        min-width: auto;
    }
}

.register-link, .login-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text);
}

.register-link a, .login-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.register-link a:hover, .login-link a:hover {
    color: #3e6b8f;
    text-decoration: underline;
}

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: var(--color-dark);
    color: white;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: var(--color-success);
}

.toast.error {
    background-color: var(--color-error);
}

.toast.warning {
    background-color: var(--color-warning);
    color: var(--color-dark);
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .tutorial-container {
        flex-direction: column;
        padding: 0 0.5rem;
        gap: 1.5rem;
    }

    .tutorial-sidebar {
        position: static;
        margin-bottom: 2rem;
        width: 100%;
        padding: 1rem;
    }

    .tutorial-content {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .nav-links {
        position: fixed;
        left: 0px;
        height: 100vh;
        top: 0;
        background-color: var(--color-dark);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: 40%;
        max-width: 280px;
        transform: translateX(-100%);
        transition: transform 0.5s ease-in;
        z-index: 1000;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 1rem 1rem 2rem;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        touch-action: pan-y;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    /* 添加背景遮罩 */
    .nav-links::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: -1;
        transform: translateX(100%);
    }

    .nav-active::before {
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        opacity: 1;
        margin: 0.5rem 0;
        width: 100%;
        text-align: center;
    }
    
    /* 优化移动端用户名显示 */
    .nav-links .dropdown-toggle {
        word-break: break-word;
        white-space: normal;
        line-height: 1.4;
        padding: 0.75rem 1rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    /* 移动端下拉菜单样式 */
    .nav-links .dropdown-menu {
        position: static;
        background-color: rgba(0, 0, 0, 0.8);
        box-shadow: none;
        margin-top: 0.5rem;
        border-radius: 8px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
        transform: translateY(-10px);
        visibility: hidden;
        padding: 0;
    }
    
    .nav-links .dropdown-menu.show {
        max-height: 200px;
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
        padding: 0.5rem 0;
    }
    
    .nav-links .dropdown-menu a {
        color: white !important;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .nav-links .dropdown-menu a:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
        color: var(--color-secondary) !important;
    }
    
    /* 深色主题下移动端下拉菜单 */
    body.dark-theme .nav-links .dropdown-menu {
        background-color: rgba(26, 32, 44, 0.95) !important;
    }
    
    body.dark-theme .nav-links .dropdown-menu a {
        color: #e2e8f0 !important;
    }
    
    body.dark-theme .nav-links .dropdown-menu a:hover {
        background-color: rgba(74, 85, 104, 0.6) !important;
        color: var(--color-secondary) !important;
    }

    .burger {
        display: block;
    }

    .nav-active {
        transform: translateX(0%);
    }

    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .toggle .line2 {
        opacity: 0;
    }

    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.2rem;
    }

    .tutorial-content {
        padding: 1.5rem;
    }

    .tutorial-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .tutorial-sidebar {
        padding: 1rem;
    }

    .code-block {
        padding: 1rem;
        font-size: 0.85rem;
        overflow-x: auto;
        word-break: break-all;
    }

    /* 优化教程导航在移动端的显示 */
    .tutorial-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tutorial-nav li {
        flex: 1 1 auto;
        margin-bottom: 0.25rem;
    }

    .tutorial-nav a {
        text-align: center;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
}

@media screen and (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 0.5rem;
    }

    .hero {
        padding: 0 1rem;
        height: 80vh;
    }

    .hero h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        width: auto;
        max-width: 280px;
    }

    .features {
        padding: 3rem 0;
    }

    .feature-box {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .testimonials {
        padding: 3rem 0;
    }

    .testimonial-box {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .tutorial-content {
        padding: 1rem;
    }

    .section {
        margin-bottom: 2rem;
    }

    .navigation-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-button {
        text-align: center;
        width: 100%;
    }

    /* 确保所有元素不超出屏幕 */
    img, video, iframe {
        max-width: 100%;
        height: auto;
    }

    /* 修复表格在小屏幕上的显示 */
    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 0.5rem;
    }

    /* 优化代码块在小屏幕上的显示 */
    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
        overflow-x: auto;
    }
}

/* 超小屏幕优化 (320px) */
@media screen and (max-width: 320px) {
    .container {
        width: 98%;
        padding: 0 0.25rem;
    }

    .hero {
        height: 75vh;
        padding: 0 0.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .hero p {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
        max-width: 250px;
    }

    .feature-box {
        padding: 1rem;
    }

    .testimonial-box {
        padding: 1rem;
    }

    /* 导航栏链接在超小屏幕上的优化 */
    .nav-links a {
        font-size: 0.9rem;
        padding: 0.7rem 0;
    }

    /* 模态框在超小屏幕上的优化 */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }

    /* 表单元素优化 */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* 防止iOS放大 */
    }
}